package tma.sdcbatch11.foodordering;

import java.util.ArrayList;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import android.app.Activity;
import android.content.Intent;



public class List_dish extends Activity implements OnClickListener{
	
	private ArrayList<View> listText;
	private ListView lvContact;
	private CustomAdapter adapter = null;
	private ArrayList<Dish> list;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list_dish);
		
		lvContact = (ListView) findViewById(R.id.lv_ListDish);
		list = new ArrayList<Dish>();
		list.add(new Dish("Cocacola", "10$"));
		list.add(new Dish("Pepsi", "10$"));
		list.add(new Dish("Tra Xanh", "11$"));
		list.add(new Dish("Sua", "7$"));
		list.add(new Dish("Nulti", "9$"));
		
		adapter = new CustomAdapter(this, R.layout.item_list_dish, list);
		lvContact.setAdapter(adapter);
		
		findViewById(R.id.btn_hide).setOnClickListener(this);
		
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		finish();
	}
}
